<template>
  <!-- 公共的遮罩层组件 -->
  <div class="um_mask">
    <div class="mask_box" align="center">
      <img src="../../assets/img/close_mask.png" v-if="!noCloseLogo" class="close_mask" @click="closeMask" title="关闭" alt="">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'maskqrcode',
  props: {
    noCloseLogo: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    /** 关闭弹窗 */
    closeMask () {
      this.$emit('closeMask')
    }
  }
}
</script>

<style lang="scss" scoped>
.um_mask {
  position: fixed;
  width: 100vw;
  height: 100vh;
  left: 0;
  top: 0;
  background: rgba(0,0,0,.2);
  z-index: 100;
  .mask_box {
    position: absolute;
    top: 50%;
    left: 50%;
    background: #fff;
    min-width: 260px;
    border-radius: 10px;
    line-height: normal;
    padding: 0 20px;
    transform: translateX(-50%) translateY(-50%);
    .close_mask {
      position: absolute;
      width: 25px;
      height: 25px;
      display: inline-block;
      right: -10px;
      top: -10px;
      z-index: 2;
      cursor: pointer;
    }
  }
}
</style>